#!python
#
# Pyste file for osg::Node

Node = Class("osg::Node", "OpenSG/OSGNode.h")
final(Node)
set_policy(Node.getClassType, return_internal_reference(1))
set_policy(Node.getType, return_internal_reference(1))
set_policy(Node.getSFVolume, return_internal_reference(1))
set_policy(Node.getSFTravMask, return_internal_reference(1))
set_policy(Node.getSFParent, return_internal_reference(1))
set_policy(Node.getSFCore, return_internal_reference(1))
set_policy(Node.getMFChildren, return_internal_reference(1))
set_policy(Node.getVolume, return_internal_reference(1))

declaration_code("""
namespace boost { namespace python
{
  template<> struct pointee<osg::NodePtr>
  {
     typedef osg::NodePtr::StoredObjectType type;
  };

  inline osg::Node* get_pointer(OSG::NodePtr const & p)
  {
      return p.getCPtr();
  }

  template <> struct pointee<osg::NodeRefPtr>
  {
     typedef osg::NodePtr::StoredObjectType type;
  };

  inline osg::Node* get_pointer(osg::NodeRefPtr const & p)
  {
      return p.get().getCPtr();
  }

}}
""")

module_code("""
    register_ptr_to_python<osg::NodePtr>();
    implicitly_convertible<osg::NodeRefPtr, osg::NodePtr>();
    implicitly_convertible<osg::NodeRefPtr, osg::FieldContainerPtr>();
    implicitly_convertible<osg::NodePtr, osg::FieldContainerPtr>();
""")
